package com.tm.d12_arrays;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 2024/5/25 Cjj student类 10：26
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Student implements Comparable<Student>{
    private String name;
    private Double height;
    private Integer age;


    @Override
    public int compareTo(Student o) {
   /*  if(this.age>o.age){
         return 1;
     }else if(this.age<o.age){
         return -1;
     }
*/
    /*    if(this.age<o.age){
            return 1;
        }else if(this.age>o.age){
            return -1;
        }*/
       /* return 0;*/

        //return this.age-o.age;
        return o.age-this.age;
    }
}
